package com.gxuwz.zlc.service.impl;

import com.gxuwz.zlc.entity.Student;
import com.gxuwz.zlc.mapper.StudentMapper;
import com.gxuwz.zlc.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentMapper studentMapper;

    @Override
    public List<Student> findStudent() {
        return studentMapper.selectList(null);
    }

    @Override
    public Student findStudentById(String stuId) {
        return studentMapper.selectById(stuId);
    }

    @Override
    public void addStudent(Student student) {
        studentMapper.insert(student);
    }

    @Override
    public void updateStudent(Student student) {
        studentMapper.updateById(student);
    }

    @Override
    public void deleteStudent(String stuId) {
        studentMapper.deleteById(stuId);
    }
}
